#ifndef __SERVO_H
#define __SERVO_H
//#include "sys.h"
#include "main.h"
#define PI 3.14159265
#define Ratio 3.7037f
#define Ratio1 7.4074f
#define PWM1   TIM4->CCR1  //PE9	250->0.5ms
#define PWM2   TIM4->CCR2  //PE11
#define PWM3   TIM4->CCR3  //PE13
#define PWM4   TIM4->CCR4  //PE14
#define u8 uint8_t
#define u16 uint16_t
//#define PWM5   TIM2->CCR3  //PB10

extern u8 Servo_flag;

extern float TargetX,TargetY,TargetZ,Target_claw;     					//���Ŀ��ֵ

u8 Kinematic_Analysis_limb(float x,float y,float z,float t);
void Servo_move(void);
void Servo_data(float x,float y,float z);
void Set_Pwm_limb(float velocity1,float velocity2,float velocity3,float velocity4);
void Xianfu_Pwm_limb(void);
void Xianfu_Pwm2_limb(void);
float Position_PID1_limb (float Encoder_limb,float Target_limb);
float Position_PID2_limb (float Encoder_limb,float Target_limb);
float Position_PID3_limb (float Encoder_limb,float Target_limb);
float Position_PID4_limb (float Encoder_limb,float Target_limb);
void hold();
void release();
void pick_car_1(void);
void pick_car_2();
void pick_car_3();
void put_car_1();
void put_car_2();
void put_car_3();

void center();
void put_ground_1();
void put_ground_2();
void put_ground_3();
void peek_1();
void pick_ground_1();
void pick_ground_2();
void pick_ground_3();
int myabs(int a);										                    //����ֵ����
#endif


